<!-- 宠物信息模板 -->
<template>
  <div class="pet-info-slot">
    <div class="photo-box">
      <slot name="pet-photo">
        <img src="~assets/img/profile/userDefault.jpg" alt="" />
      </slot>
    </div>
    <div class="pet-profile">
      <div class="pro-box">
        <div class="pet-name"><slot name="pet-name"></slot></div>
        <div :class="genderClass">
          <slot name="breed-gender" class="breed-gender"></slot>
        </div>
      </div>
      <div class="pro-box">
        <div class="pet-age">
          <slot name="pet-age"></slot>
        </div>
        <div class="pet-ster">
          <slot name="pet-ster"></slot>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "PetInfoSlot",
  props:{
    gender:{
      type: Number,
      default: 1
    }
  },
  data() {
    return {};
  },
  computed:{
    genderClass(){
      return this.gender===1 ? 'breed-gender-boy' : 'breed-gender-girl';
    }
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {},
};
</script>

<style scoped>
.pet-info-slot{
  display: flex;
  background-color: #f7f7f7;
  padding: 15px;
  margin: 10px 20px;
  border-radius: 10px;
}
.photo-box {
  width: 65px;
  height: 65px;
  overflow: hidden;
  border-radius: 50%;
}
.photo-box img{
  width: 100%;
}
.pet-profile{
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 14px;
}
.pro-box{
  padding: 6px 10px;
}
.pro-box div{
  display: inline-block;
}
.pet-name{
  font-size: 17px;
  margin-right: 10px;
}
.breed-gender-girl{
  color: #ff6b89;
  padding: 3px 8px;
  background-color: #faebee;
}
.breed-gender-boy{
  color: #0290fc;
  padding: 3px 8px;
  background-color: #e0f2ff;
}
.pro-box:nth-child(2){
  color: rgb(160, 159, 159);
}
.pro-box:nth-child(2) div:first-child{
  margin-right: 20px;
}
</style>